Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Collector): docs and types #5937

Merged
merged 1 commit into from
Jun 28, 2021
Merged

fix(Collector): docs and types #5937

merged 1 commit into from
Jun 28, 2021

Conversation

vaporoxx
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

This PR is smaller than it sounds but I'm explaining every change in detail here because I don't want to open yet another fix PR lol

Docs:

  • The return type of MessageComponentInteractionCollector#collect() was changed from ?(Snowflake|string) to just ?Snowflake because it only returns either null or the interaction ID
  • The return type of ReactionCollector#collect() was changed from Promise<Snowflake|string> to Promise<?(Snowflake|string)> because it can return null as well
  • The return type of Collector#collect() was changed from... whatever that was before to ?(*|Promise<?*>) so that extended classes can specify whether it returns a promise or not

Types:

  • Collector got another type parameter for additional filter parameters
  • Collector#collect() can now return a promise, which should be specified on extended classes as explained above
  • All collect() and dispose() methods got null added to their return type (probably an oversight)
  • A user parameter was added to ReactionCollector#collect() (probably another oversight)

Miscellaneous:

  • An await keyword was added in Collector#handleCollect() because this.collect() is asynchronous for reaction collectors

Status and versioning classification:

  • I know how to update typings and have done so

@monbrey
Copy link
Member

monbrey commented Jun 27, 2021

#5936 might impact this, at least in regards to the MessageComponentInteractionCollector (which no longer exists)

@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
@iCrawl iCrawl merged commit 6c447b1 into discordjs:master Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants